package com.ithiema.homework.t2;

import java.util.ArrayList;
import java.util.Random;

public class Entry {
    public static void main(String[] args) {
        String[] color = {"♥","♠","♣","♦"};
        String[] cardNum = {"A","2","3","4","5","6","7","8","9","10","J","Q","K"};
        ArrayList<String> card = new ArrayList<>();
        for (int i = 0; i < color.length; i++) {
            for (int i1 = 0; i1 < cardNum.length; i1++) {
                card.add(color[i] + cardNum[i1]);
            }
        }
        card.add("smallJoker");
        card.add("bigJoker");
        ArrayList<String> gamer1 = new ArrayList<>();
        ArrayList<String> gamer2 = new ArrayList<>();
        ArrayList<String> gamer3 = new ArrayList<>();
        Random r = new Random();
        for (int i = 0; i < 51; i++) {
            int a = r.nextInt(card.size());
            int num = i % 3;
            switch (num){
                case 0:
                    gamer1.add(card.get(a));
                    card.remove(card.get(a));
                    break;
                case 1:
                    gamer2.add(card.get(a));
                    card.remove(card.get(a));
                    break;
                case 2:
                    gamer3.add(card.get(a));
                    card.remove(card.get(a));
                    break;
            }
        }
        System.out.println("玩家一的牌是:" + gamer1);
        System.out.println("玩家二的牌是:" + gamer2);
        System.out.println("玩家三的牌是:" + gamer3);
        System.out.println("底牌是:" + card);
    }
}
